#ifndef WINDOW_H_INCLUDED
#define WINDOW_H_INCLUDED

#include <string>
#include "canvas.h"

namespace axelynx
{
    enum WindowMode
    {
        WM_WINDOWED
        ,WM_FULLSCREEN
        ,WM_SPLASH
        ,WM_SIZEBLE
    };

    class WindowDesc
    {
        public:

        int width_;
        int height_;
        int depth_;
        int antialias_;
        std::wstring caption_;
        WindowMode wm_;
        bool doublebuffers_;

        public:
        WindowDesc()
        :
            width_(800)
            ,height_(600)
            ,depth_(32)
            ,antialias_(0)
            ,caption_(L"Axelynx Application")
            ,wm_(WM_WINDOWED)
            ,doublebuffers_(1)
        {}

        WindowDesc& size(int width,int height)
        {
            width_ = width;
            height_ = height;
            return *this;
        }

        WindowDesc& title(std::wstring caption)
        {caption_ = caption;    return *this;}

        WindowDesc& depth(int bpp)
        {depth_ = bpp;          return *this;}

        WindowDesc& mode(WindowMode wm)
        {wm_ = wm;             return *this;}

        WindowDesc& antialias(int numsamples)
        {antialias_ = numsamples;             return *this;}

        WindowDesc& doublebuffer(bool db)
        {doublebuffers_ = db;             return *this;}
    };

    class Window
    {
        public:
        virtual void SetTitle(std::string titleA) = 0;
        virtual void SetTitle(std::wstring titleW) = 0;

        //! Flip backbuffer (if enabled)
        virtual void Flip() = 0;

        //! Sync window with OS (theare updating input, system events, etc.)
        virtual void Sync() = 0;

        virtual void Free() = 0;

        virtual WindowDesc GetDescriptor() = 0;

        virtual Canvas* GetCanvas() = 0;

        virtual bool isEnabled() = 0;
        virtual bool isActive() = 0;

        virtual Window* Current() =0;

        virtual int Width() =0;
        virtual int Height() =0;
    };
}

#endif // WINDOW_H_INCLUDED
